package com.example.stugradeapp

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.android.synthetic.main.activity_add.*

class AddActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_add)

        add_button.setOnClickListener{
            val myDB = MyDatabaseHelper(this)
            myDB.addBook(title_input.text.toString(),author_input.text.toString(),pages_input.text.toString().toInt())
            val intent  = Intent(this,MainActivity::class.java)
            startActivity(intent)
        }
    }
}